# -*- coding: utf-8 -*-
from django.db import models
from datetime import datetime


	
class Categoria(models.Model):
	nome = models.CharField(max_length=50)
	maximo = models.FloatField()
	minimo = models.FloatField()
	
	class Meta:
		ordering = ('nome',)
		
	def __unicode__(self):
		return self.nome
		
class Evento(models.Model):
	datahora = models.DateTimeField(default=datetime.now, blank=True)
	valor = models.FloatField()
	categoriaid = models.ForeignKey('Categoria')
	
	class Meta:
		ordering = ('datahora',)
		
	def __unicode__(self):
		return str(self.categoriaid) + ' de ' + str(self.datahora)
		


	